package com.pattern.bridge;

import junit.framework.Assert;

import org.junit.Test;

public class BridgeCupMakerTest {
	@Test
	public void testBigGlassRedCupMaker() {
		CupMaker cupMaker = new BigCupMaker(new RedPainter(),
				new GlassMaterial());
		Cup cup = cupMaker.makeCup();
		assertCup("big", "red", "glass", cup);
	}

	@Test
	public void testBigGlassGreenCupMaker() {
		CupMaker cupMaker = new BigCupMaker(new GreenPainter(),
				new GlassMaterial());
		Cup cup = cupMaker.makeCup();
		assertCup("big", "green", "glass", cup);
	}

	@Test
	public void testBigGlassGrayCupMaker() {
		CupMaker cupMaker = new BigCupMaker(new GrayPainter(),
				new GlassMaterial());
		Cup cup = cupMaker.makeCup();
		assertCup("big", "gray", "glass", cup);
	}
	@Test
	public void testSmallGlassRedCupMaker() {
		CupMaker cupMaker = new SmallCupMaker(new RedPainter(),
				new GlassMaterial());
		Cup cup = cupMaker.makeCup();
		assertCup("small", "red", "glass", cup);
	}
	
	@Test
	public void testSmallGlassGreenCupMaker() {
		CupMaker cupMaker = new SmallCupMaker(new GreenPainter(),
				new GlassMaterial());
		Cup cup = cupMaker.makeCup();
		assertCup("small", "green", "glass", cup);
	}
	
	@Test
	public void testSmallGlassGrayCupMaker() {
		CupMaker cupMaker = new SmallCupMaker(new GrayPainter(),
				new GlassMaterial());
		Cup cup = cupMaker.makeCup();
		assertCup("small", "gray", "glass", cup);
	}
	public void testMidGlassRedCupMaker() {
		CupMaker cupMaker = new MidCupMaker(new RedPainter(),
				new GlassMaterial());
		Cup cup = cupMaker.makeCup();
		assertCup("mid", "red", "glass", cup);
	}
	
	@Test
	public void testMidGlassGreenCupMaker() {
		CupMaker cupMaker = new MidCupMaker(new GreenPainter(),
				new GlassMaterial());
		Cup cup = cupMaker.makeCup();
		assertCup("mid", "green", "glass", cup);
	}
	
	@Test
	public void testvGlassGrayCupMaker() {
		CupMaker cupMaker = new MidCupMaker(new GrayPainter(),
				new GlassMaterial());
		Cup cup = cupMaker.makeCup();
		assertCup("mid", "gray", "glass", cup);
	}
	private void assertCup(String size, String color, String material, Cup cup) {
		Assert.assertEquals(material, cup.getMaterial());
		Assert.assertEquals(size, cup.getSize());
		Assert.assertEquals(color, cup.getColor());
	}
}
